package com.haiheng.library_base.db

import androidx.room.*

/**
 *
 * @Des:
 * @Author: hwz
 * @Date:2022/5/25 0025
 * @Version: 1.0
 */
@Dao
interface LayerMapDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insert(layerMap: LayerMap): Long

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insert(layerMap: List<LayerMap>): List<Long>

    @Delete
    suspend fun delete(layerMap: LayerMap): Int

    @Delete
    fun deleteList(layerMap: List<LayerMap>)

    @Update
    suspend fun update(layerMap: LayerMap): Int

    @Query("SELECT * FROM layer_map WHERE outValue IN(:outValue)")
    suspend fun queryByOutValue(outValue: String): LayerMap

    @Query("SELECT * FROM layer_map WHERE id IN(:id)")
    fun queryById(id:String): LayerMap

    @Query("SELECT * FROM layer_map WHERE name IN(:name)")
    fun queryByName(name:String): LayerMap

//    @Query("SELECT * FROM layer_map WHERE outValue IN(:outValue)")
//    fun queryByOutValueList(outValue:List<String>): List<LayerMap>


}